﻿using Abp.Application.Navigation;
using Abp.Localization;
using Akso.Authorization;
using Akso.Web.Navigation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Akso.Web.Areas.Inventory.Startup
{
    public class InventoryNavigationProvider: NavigationProvider
    {
        public const string MenuName = "Inventory";

        public override void SetNavigation(INavigationProviderContext context)
        {
            var menu = context.Manager.Menus[MenuName] = new MenuDefinition(MenuName, new FixedLocalizableString("Inventory Menu"));

            menu
                .AddItem(new MenuItemDefinition(
                    PageNames.App.Business.Inventory,
                    L("Menu_Inventory"),
                    icon: "icon-wrench"
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Business.Inbounds,
                        L("Menu_Inventory.Inbounds"),
                        url: "Inventory/Inbounds",
                        icon: "icon-layers",
                        requiredPermissionName: AppPermissions.Pages_Inventory_Inbounds
                        )
                    ).AddItem(new MenuItemDefinition(
                        PageNames.App.Business.Outbounds,
                        L("Menu_Inventory.Outbounds"),
                        url: "Inventory/Outbounds",
                        icon:"icon-layers",
                        requiredPermissionName:AppPermissions.Pages_Inventory_Outbounds
                        )
                    
                    )
                );
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, AbpZeroTemplateConsts.LocalizationSourceName);
        }
    }
}